package com.shareach.redis;

import java.util.Set;

import redis.clients.jedis.Client;
import redis.clients.jedis.Protocol;
import redis.clients.util.SafeEncoder;

public class NewClient extends Client{

	public NewClient(String host){
        super(host);
    }

    public NewClient(String host, int port){
        super(host, port);
    }

    public void srem(String key, Set<String> members) throws Exception{
    	byte[][] target = new byte[members.size()+1][];
        byte[] keyByte = SafeEncoder.encode(key);
        int i =0;
        target[i] = keyByte;
        for(String member : members){
        	target[++i] = SafeEncoder.encode(member);
        }
    	sendCommand(Protocol.Command.SREM,target);
    }
}
